home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Development Tools & Languages / Macintosh Common Lisp Related / interfaces / PInterface Translator / OCE Interfaces / OCEMail.p < prev    next >
Encoding:
Text File  |  1993-09-16  |  41.6 KB  |  1,551 lines  |  [TEXT/MPS ]

  1. {***********************************************************
  2.  
  3. Created: Saturday, February 13, 1993 at 2:05PM
  4.  OCEMail.p
  5.  Pascal Interface to the Macintosh Libraries
  6.  
  7.     ••• Apple Confidential •••
  8.     ••• Provided with AOCE Beta seed under license agreement with   •••
  9.     ••• Apple Computer, Inc.  Use for any purpose other than        •••
  10.     ••• development of AOCE-based Macintosh products is a violation •••
  11.     ••• of the license agreement.                                   •••
  12.  
  13.   Copyright Apple Computer, Inc. 1990-1993
  14.   All rights reserved
  15.  
  16. ***********************************************************}
  17.  
  18.  
  19. {$IFC UNDEFINED UsingIncludes}
  20. {$SETC UsingIncludes:= 0}
  21. {$ENDC}
  22.  
  23. {$IFC NOT UsingIncludes}
  24.     UNIT OCEMail;
  25.     INTERFACE
  26. {$ENDC}
  27.  
  28. {$IFC UNDEFINED UsingOCEMail}
  29. {$SETC UsingOCEMail:= 1}
  30.  
  31. {$I+}
  32. {$SETC OCEMailIncludes:= UsingIncludes}
  33. {$SETC UsingIncludes:= 1}
  34.  
  35.  
  36. {$IFC UNDEFINED UsingDigitalSignature}
  37. {$I DigitalSignature.p}
  38. {$ENDC}
  39.  
  40. {$IFC UNDEFINED UsingFiles}
  41. {$I $$Shell(PInterfaces)Files.p}
  42. {$ENDC}
  43.  
  44. {$IFC UNDEFINED UsingMemory}
  45. {$I $$Shell(PInterfaces)Memory.p}
  46. {$ENDC}
  47.  
  48. {$IFC UNDEFINED UsingOCE}
  49. {$I OCE.p}
  50. {$ENDC}
  51.  
  52. {$IFC UNDEFINED UsingOCEAuthDir}
  53. {$I OCEAuthDir.p}
  54. {$ENDC}
  55.  
  56. {$IFC UNDEFINED UsingOCEMessaging}
  57. {$I OCEMessaging.p}
  58. {$ENDC}
  59.  
  60. {$IFC UNDEFINED UsingTextEdit}
  61. {$I $$Shell(PInterfaces)TextEdit.p}
  62. {$ENDC}
  63.  
  64. {$IFC UNDEFINED UsingTypes}
  65. {$I $$Shell(PInterfaces)Types.p}
  66. {$ENDC}
  67.  
  68. {$SETC UsingIncludes:= OCEMailIncludes}
  69.  
  70. {************************************************************************************}
  71. { Common Definitions }
  72. {************************************************************************************}
  73. TYPE
  74. MailParamBlockHeader = RECORD
  75.     qLink:    Ptr;
  76.     reservedH1: LONGINT;
  77.     reservedH2: LONGINT;
  78.     ioCompletion: ProcPtr;
  79.     ioResult: OSErr;
  80.     saveA5: LONGINT;
  81.     reqCode: INTEGER;
  82.     END;
  83.  
  84. MailMsgRef = LONGINT;                    { reference to a new or open letter or message }
  85.  
  86. MSAMQueueRef = LONGINT;                    { reference to an open msam queue }
  87. MSAMSlotID = INTEGER;                    { identifies slots managed by a PMSAM }
  88.  
  89. MailboxRef = LONGINT;                    { reference to an active mailbox }
  90. MailSlotID = INTEGER;                    { identifies slots within a mailbox }
  91.  
  92. MailSeqNum = RECORD                        { identifies a letter in a mailbox }
  93.     slotID: MailSlotID;
  94.     seqNum: LONGINT;
  95.     END;
  96.  
  97.  
  98. { A MailBuffer is used to describe a buffer used for an IO operation.
  99. The location of the buffer is pointed to by 'buffer'.
  100. When reading, the size of the buffer is 'bufferSize'
  101. and the size of data actually read is 'dataSize'.
  102. When writing, the size of data to be written is 'bufferSize'
  103. and the size of data actually written is 'dataSize'.
  104. }
  105.  
  106. MailBuffer = RECORD
  107.     bufferSize: LONGINT;
  108.     buffer: Ptr;
  109.     dataSize: LONGINT;
  110.     END;
  111.  
  112.  
  113. { A MailReply is used to describe a commonly used reply buffer format.
  114. It contains a count of tuples followed by an array of tuples.
  115. The format of the tuple itself depends on each particular call.
  116. }
  117. MailReply = RECORD
  118.     tupleCount: INTEGER;
  119.     { tuple[1..tupleCount] }
  120.     END;
  121.  
  122.  
  123. { Shared Memory Communication Area used when Mail Manager sends
  124. High Level Events to a PMSAM.
  125. }
  126. SMCA = RECORD
  127.     smcaLength: INTEGER;                    { includes size of length field }
  128.     result: OSErr;
  129.     userBytes: LONGINT;
  130.     CASE INTEGER OF
  131.         1: (slotCID: CreationID);            { may not be used in some cases }
  132.         2: (msgHint: LONGINT);
  133.     END;
  134.  
  135.  
  136. {************************************************************************************}
  137. CONST
  138. { Value of creator and types fields for messages and blocks defined by MailManager }
  139. kMailAppleMailCreator        = 'apml';    { message and letter block creator }
  140.  
  141. kMailLtrMsgType                = 'lttr';    { msg type of letters, reports }
  142. kMailLtrHdrType                = 'lthd';    { contains letter header }
  143. kMailContentType            = 'body';    { contains content of letter }
  144. kMailEnclosureListType        = 'elst';    { contains list of enclosures }
  145. kMailEnclosureDesktopType    = 'edsk';    { contains desktop mgr info for enclosures }
  146.  
  147. kMailEnclosureFileType        = 'asgl';    { contains a file enclosure }
  148. { format is defined by AppleSingle }
  149.  
  150. kMailImageBodyType            = 'imag';    { contains image of letter }
  151. {        format is struct TPfPgDir         - in Printing.h
  152.         TPfPgDir = RECORD
  153.             pageCount: INTEGER;            - number of pages in the image.
  154.             iPgPos: LONGINT[1..129];    - iPgPos[n] is the offset from the start of the block
  155.             END;
  156.                                         - to image of page n.
  157.                                         - iPgPos[n+1] - iPgPos[n] is the length of page n.
  158. }
  159.  
  160. kMailMSAMType                = 'gwyi';    { contains msam specific information }
  161.  
  162. kMailTunnelLtrType            = 'tunl';    { used to read a tunnelled message }
  163. kMailHopInfoType            = 'hopi';    { used to read hopInfo for a tunnelled message }
  164.  
  165. kMailReportType                = 'rpti';    { contains report info }
  166. {
  167. Reports have the isReport bit set in MailIndications and contain a block of type kMailReport.
  168. This block has a header, IPMReportBlockHeader,
  169. followed by an array of elements, each of type IPMRecipientReport
  170. }
  171.  
  172. { Various families used by mail or related msgs }
  173. kMailFamily                    = 'mail';    { Defines family of "mail" msgs: content, header, etc }
  174. kMailFamilyFile                = 'file';    { Defines family of "direct display" msgs }
  175.  
  176. {************************************************************************************}
  177. TYPE
  178. MailAttributeID = INTEGER;
  179.  
  180.  
  181. CONST
  182. { Values of MailAttributeID }
  183. { Message store attributes - stored in the catalog }
  184. { Will always be present in a letter and have fixed sizes }
  185. kMailLetterFlagsBit        = 1;            { MailLetterFlags }
  186.  
  187. { Letter attributes - stored in the letter }
  188. { Will always be present in a letter and have fixed sizes }
  189. kMailIndicationsBit        = 3;            { MailIndications }
  190. kMailMsgTypeBit            = 4;            { OCECreatorType }
  191. kMailLetterIDBit        = 5;            { MailLetterID }
  192. kMailSendTimeStampBit    = 6;            { MailTime }
  193. kMailNestingLevelBit    = 7;            { MailNestingLevel }
  194. kMailMsgFamilyBit        = 8;            { OSType }
  195.  
  196. { Letter attributes - stored in the letter }
  197. { May be present in a letter and have fixed sizes }
  198. kMailReplyIDBit                = 9;        { MailLetterID }
  199. kMailConversationIDBit        = 10;        { MailLetterID }
  200.  
  201. { Letter attributes - stored in the letter }
  202. { May be present in a letter and have variable length sizes }
  203. kMailSubjectBit            = 11;            { RString }
  204. kMailFromBit            = 12;            { MailRecipient }
  205. kMailToBit                = 13;            { MailRecipient }
  206. kMailCcBit                = 14;            { MailRecipient }
  207. kMailBccBit                = 15;            { MailRecipient }
  208.  
  209. TYPE
  210. MailAttributeMask = LONGINT;
  211.  
  212. CONST
  213. { Values of MailAttributeMask }
  214. kMailLetterFlagsMask        = $00000001;  {1<<(kMailLetterFlagsBit-1)}
  215. kMailIndicationsMask        = $00000004;  {1<<(kMailIndicationsBit-1)}
  216. kMailMsgTypeMask            = $00000008;  {1<<(kMailMsgTypeBit-1)}
  217. kMailLetterIDMask            = $00000010;  {1<<(kMailLetterIDBit-1)}
  218. kMailSendTimeStampMask        = $00000020;  {1<<(kMailSendTimeStampBit-1)}
  219. kMailNestingLevelMask        = $00000040;  {1<<(kMailNestingLevelBit-1)}
  220. kMailMsgFamilyMask            = $00000080;  {1<<(kMailMsgFamilyBit-1)}
  221. kMailReplyIDMask            = $00000100;  {1<<(kMailReplyIDBit-1)}
  222. kMailConversationIDMask        = $00000200;  {1<<(kMailConversationIDBit-1)}
  223. kMailSubjectMask            = $00000400;  {1<<(kMailSubjectBit-1)}
  224. kMailFromMask                = $00000800;  {1<<(kMailFromBit-1)}
  225. kMailToMask                    = $00001000;  {1<<(kMailToBit-1)}
  226. kMailCcMask                    = $00002000;  {1<<(kMailCcBit-1)}
  227. kMailBccMask                = $00004000;  {1<<(kMailBccBit-1)}
  228.  
  229.  
  230.  
  231. TYPE
  232. MailAttributeBitmap = PACKED RECORD
  233.         reservedA:            0..65535;    { 16 bits }
  234.         reservedB:            0..1;
  235.         bcc:                0..1;        { BOOLEAN }
  236.         cc:                    0..1;        { BOOLEAN }
  237.         toRecipient:        0..1;        { BOOLEAN }
  238.         from:                0..1;        { BOOLEAN }
  239.         subject:            0..1;        { BOOLEAN }
  240.         conversationID:        0..1;        { BOOLEAN }
  241.         replyID:            0..1;        { BOOLEAN }
  242.         msgFamily:            0..1;        { BOOLEAN }
  243.         nestingLevel:        0..1;        { BOOLEAN }
  244.         sendTimeStamp:        0..1;        { BOOLEAN }
  245.         letterID:            0..1;        { BOOLEAN }
  246.         msgType:            0..1;        { BOOLEAN }
  247.         indications:        0..1;        { BOOLEAN }
  248.         reservedC:            0..1;        { BOOLEAN }
  249.         letterFlags:        0..1;        { BOOLEAN }
  250.     END;
  251.  
  252.  
  253. {************************************************************************************}
  254. MailLetterSystemFlags = INTEGER;
  255.  
  256. CONST
  257. { Values of MailLetterSystemFlags }
  258. kMailIsLocalBit = 2;                    { letter is available locally (either by nature or via cache) }
  259.  
  260. kMailIsLocalMask            = $0004;  {1<<kMailIsLocalBit}
  261.  
  262.  
  263. TYPE
  264. MailLetterUserFlags = INTEGER;
  265.  
  266. CONST
  267. kMailReadBit = 0;                    { this letter has been opened }
  268. kMailDontArchiveBit = 1;            { this letter is not }
  269.                                     { to be archived either because }
  270.                                     { it has already been archived or }
  271.                                     { it should not be archived. }
  272. kMailInTrashBit = 2;                { this letter is in trash }
  273.  
  274.  
  275. { Values of MailLetterUserFlags }
  276. kMailReadMask            = $0001;  {1<<kMailReadBit}
  277. kMailDontArchiveMask    = $0002;  {1<<kMailDontArchiveBit}
  278. kMailInTrashMask        = $0004;  {1<<kMailInTrashBit}
  279.  
  280.  
  281. TYPE
  282. MailLetterFlags = RECORD
  283.     sysFlags: MailLetterSystemFlags;
  284.     userFlags: MailLetterUserFlags;
  285.     END;
  286.  
  287.  
  288. MailMaskedLetterFlags = RECORD
  289.     flagMask: MailLetterFlags;            { flags that are to be set }
  290.     flagValues: MailLetterFlags;        { and their values }
  291.     END;
  292.  
  293.  
  294. CONST
  295. kMailOriginalInReportBit = 1;
  296. kMailNonReceiptReportsBit = 3;
  297. kMailReceiptReportsBit = 4;
  298. kMailForwardedBit = 5;
  299. kMailPriorityBit = 6;
  300. kMailIsReportWithOriginalBit = 8;
  301. kMailIsReportBit = 9;
  302. kMailHasContentBit = 10;
  303. kMailHasSignatureBit = 11;
  304. kMailAuthenticatedBit = 12;
  305. kMailSentBit = 13;
  306.  
  307. CONST
  308. { Values of MailIndications }
  309. kMailSentMask                    = $00001000;  {1<<(kMailSentBit-1)}
  310. kMailAuthenticatedMask            = $00000800;  {1<<(kMailAuthenticatedBit-1)}
  311. kMailHasSignatureMask            = $00000400;  {1<<(kMailHasSignatureBit-1)}
  312. kMailHasContentMask                = $00000200;  {1<<(kMailHasContentBit-1)}
  313. kMailIsReportMask                = $00000100;  {1<<(kMailIsReportBit-1)}
  314. kMailIsReportWithOriginalMask    = $00000080;  {1<<(kMailIsReportWithOriginalBit-1)}
  315. kMailPriorityMask                = $00000060;  {3<<(kMailPriorityBit-1)}
  316. kMailForwardedMask                = $00000010;  {1<<(kMailForwardedBit-1)}
  317. kMailReceiptReportsMask            = $00000008;  {1<<(kMailReceiptReportsBit-1)}
  318. kMailNonReceiptReportsMask        = $00000004;  {1<<(kMailNonReceiptReportsBit-1)}
  319. kMailOriginalInReportMask        = $00000003;  {3<<kMailOriginalInReportBit-1)}
  320.  
  321.  
  322. TYPE
  323. MailIndications = PACKED RECORD
  324.     reservedB:                 0..65535;    { 16 bits }
  325.     hasStandardContent:        0..1;        { this letter has standard interchange content }
  326.     hasImageContent:        0..1;        { this letter has a standard image }
  327.     hasNativeContent:        0..1;        { this letter has a main enclosure }
  328.     sent:                    0..1;        { this letter was sent, not just composed }
  329.     authenticated:            0..1;        { this letter was created and transported with authentication }
  330.     hasSignature:            0..1;        { this letter was signed with a digital signature }
  331.     hasContent:                0..1;        { this letter has content }
  332.     isReport:                0..1;        { this letter is really a report }
  333.     isReportWithOriginal:    0..1;        { this report contains the original letter }
  334.  
  335.     priority:                0..3;        { Bits defined as in IPMPriority }
  336.                                         { the originator has: }
  337.     forwarded:                0..1;        {        forwarded this letter }
  338.  
  339.                                         { the originator requests: }
  340.     receiptReports:            0..1;        {        delivery reports }
  341.     nonReceiptReports:        0..1;        {        non-delivery reports }
  342.     originalInReport:        0..3;        {        original letter to be enclosed in reports }
  343.     END;
  344.  
  345.  
  346. CONST
  347. { values of the field originalInReport in MailIndications }
  348. kMailNoOriginal                = 0;        { do not enclose original in reports }
  349. kMailEncloseOnNonReceipt    = 3;        { enclose original in non-delivery reports }
  350.  
  351.  
  352. TYPE
  353. MailLetterID = IPMMsgID;
  354.  
  355. MailTime = RECORD
  356.     time: UTCTime;                        { current UTC(GMT) time }
  357.     offset: UTCOffset;                    { offset from GMT }
  358.     END;
  359.  
  360.  
  361. MailNestingLevel = INTEGER;                { innermost letter has nestingLevel 0 }
  362.  
  363. MailRecipient = OCERecipient;
  364.  
  365. {************************************************************************************}
  366. CONST
  367. kMailTextSegmentBit = 0;
  368. kMailPictSegmentBit = 1;
  369. kMailSoundSegmentBit = 2;
  370. kMailStyledTextSegmentBit = 3;
  371. kMailMovieSegmentBit = 4;
  372.  
  373. TYPE
  374. MailSegmentMask = INTEGER;
  375.  
  376. CONST
  377. { Values of MailSegmentMask }
  378. kMailTextSegmentMask        = $0001;  {1<<kMailTextSegmentBit}
  379. kMailPictSegmentMask        = $0002;  {1<<kMailPictSegmentBit}
  380. kMailSoundSegmentMask        = $0004;  {1<<kMailSoundSegmentBit}
  381. kMailStyledTextSegmentMask    = $0008;  {1<<kMailStyledTextSegmentBit}
  382. kMailMovieSegmentMask        = $0010;  {1<<kMailMovieSegmentBit}
  383.  
  384.  
  385. TYPE
  386. MailSegmentType = INTEGER;
  387.  
  388. CONST
  389. { Values of MailSegmentType }
  390. kMailInvalidSegmentType        = 0;
  391. kMailTextSegmentType        = 1;
  392. kMailPictSegmentType        = 2;
  393. kMailSoundSegmentType        = 3;
  394. kMailStyledTextSegmentType    = 4;
  395. kMailMovieSegmentType        = 5;
  396.  
  397.  
  398.  
  399. {************************************************************************************}
  400. kMailErrorLogEntryVersion         = $101;
  401. kMailMSAMErrorStringListID        = 128;    { These 'STR#' resources should be }
  402. kMailMSAMActionStringListID        = 129;    { in the PMSAM resource fork }
  403.  
  404. TYPE
  405. MailLogErrorType = INTEGER;
  406.  
  407. CONST
  408. { Values of MailLogErrorType }
  409. kMailELECorrectable            = 0;
  410. kMailELEError                = 1;
  411. kMailELEWarning                = 2;
  412. kMailELEInformational        = 3;
  413.  
  414.  
  415. TYPE
  416. MailLogErrorCode = INTEGER;
  417.  
  418. CONST
  419. { Values of MailLogErrorCode }
  420.                                     { positive codes are indices into }
  421.                                     { PMSAM defined STRINGs }
  422. kMailMSAMErrorCode            = 0;
  423. kMailMiscError                = -1;    { negative codes are OCE defined }
  424. kMailNoModem                = -2;    { modem required, but missing }
  425.  
  426.  
  427. TYPE
  428. MailErrorLogEntryInfo = RECORD            { < 128 bytes }
  429.     version: INTEGER;
  430.     timeOccurred: UTCTime;                { do not fill in }
  431.     reportingPMSAM: Str31;                { do not fill in }
  432.     reportingMSAMSlot: Str31;            { do not fill in }
  433.     errorType: MailLogErrorType;
  434.     errorCode: MailLogErrorCode;
  435.     errorResource: INTEGER;                { resources are valid if }
  436.     actionResource: INTEGER;            { errorCode = kMailMSAMErrorCode }
  437.                                         { index starts from 1 }
  438.     filler: LONGINT;
  439.     filler2: INTEGER;
  440.     END;
  441.  
  442.  
  443. {************************************************************************************}
  444. MailBlockMode = INTEGER;
  445.  
  446. CONST
  447. { Values of MailBlockMode }
  448. kMailFromStart        = 1;                { write data from offset calculated from }
  449. kMailFromLEOB        = 2;                { start of block, end of block, }
  450. kMailFromMark        = 3;                { or from the current mark }
  451.  
  452.  
  453. TYPE
  454. MailEnclosureInfo = RECORD
  455.     enclosureName: StringPtr;
  456.     catInfo: CInfoPBPtr;
  457.     comment: StringPtr;
  458.     icon: Ptr;
  459.     END;
  460.  
  461.  
  462. {************************************************************************************}
  463. { Definitions for Personal MSAMs }
  464. {************************************************************************************}
  465. CONST
  466. kMailEPPCMsgVersion            = 2;
  467.  
  468. TYPE
  469. MailEPPCMsg = RECORD
  470.     version: INTEGER;
  471.     smca: ^SMCA;
  472.     END;
  473.  
  474.  
  475. CONST
  476. { Values of OCE defined High Level Event message classes }
  477. kMailEPPCCreateSlot        = 'crsl';
  478. kMailEPPCModifySlot        = 'mdsl';
  479. kMailEPPCDeleteSlot        = 'dlsl';
  480. kMailEPPCShutDown        = 'quit';
  481. kMailEPPCMailboxOpened    = 'mbop';
  482. kMailEPPCMailboxClosed    = 'mbcl';
  483. kMailEPPCMsgPending        = 'msgp';
  484. kMailEPPCSendImmediate    = 'sndi';
  485. kMailEPPCContinue        = 'cont';
  486. kMailEPPCSchedule        = 'sked';
  487. kMailEPPCAdmin            = 'admn';
  488. kMailEPPCInQUpdate        = 'inqu';
  489. kMailEPPCMsgOpened        = 'msgo';
  490. kMailEPPCDeleteOutQMsg    = 'dlom';
  491. kMailEPPCWakeup            = 'wkup';
  492.  
  493.  
  494. TYPE
  495. MailTimer = RECORD
  496.     CASE INTEGER OF
  497.         1: (frequency: LONGINT);        { how often to connect (secs) }
  498.         2: (connectTime: LONGINT);        { time since midnight (secs) }
  499.     END;
  500.  
  501. CONST
  502. kMailTimerOff        = 0;                { control is off }
  503. kMailTimerTime        = 1;                { specifies connect time (relative to midnight) }
  504. kMailTimerFrequency    = 2;                { specifies connect frequency }
  505.  
  506.  
  507. TYPE
  508. MailTimerKind = Byte;
  509.  
  510. MailTimers = PACKED RECORD
  511.     sendTimeKind: MailTimerKind;        { either kMailTimerTime or kMailTimerFrequency }
  512.     receiveTimeKind: MailTimerKind;        { either kMailTimerTime or kMailTimerFrequency }
  513.     send: MailTimer;
  514.     receive: MailTimer;
  515.     END;
  516.  
  517.  
  518. MailStandardSlotInfoAttribute = PACKED RECORD
  519.     version: INTEGER;
  520.     active: BOOLEAN;                    { true if slot is active }
  521.     padByte: Byte;
  522.     sendReceiveTimer: MailTimers;
  523.     END;
  524.  
  525.  
  526. PMSAMGetMSAMRecordPB = RECORD
  527.     qLink:    Ptr;
  528.     reservedH1: LONGINT;
  529.     reservedH2: LONGINT;
  530.     ioCompletion: ProcPtr;
  531.     ioResult: OSErr;
  532.     saveA5: LONGINT;
  533.     reqCode: INTEGER;
  534.  
  535.     msamCID: CreationID;
  536.     END;
  537.  
  538.  
  539. PMSAMOpenQueuesPB = RECORD
  540.     qLink:    Ptr;
  541.     reservedH1: LONGINT;
  542.     reservedH2: LONGINT;
  543.     ioCompletion: ProcPtr;
  544.     ioResult: OSErr;
  545.     saveA5: LONGINT;
  546.     reqCode: INTEGER;
  547.  
  548.     inQueueRef: MSAMQueueRef;
  549.     outQueueRef: MSAMQueueRef;
  550.     msamSlotID: MSAMSlotID;
  551.     filler: ARRAY[1..2] OF LONGINT;
  552.     END;
  553.  
  554.  
  555. PMSAMStatus = INTEGER;
  556.  
  557. CONST
  558. { Values of PMSAMStatus }
  559. kPMSAMStatusPending    = 1;                { for inQueue and outQueue }
  560. kPMSAMStatusError    = 2;                { for inQueue and outQueue }
  561. kPMSAMStatusSending    = 3;                { for outQueue only }
  562. kPMSAMStatusCaching    = 4;                { for inQueue only }
  563. kPMSAMStatusSent    = 5;                { for outQueue only }
  564.  
  565.  
  566. TYPE
  567. PMSAMSetStatusPB = RECORD
  568.     qLink:    Ptr;
  569.     reservedH1: LONGINT;
  570.     reservedH2: LONGINT;
  571.     ioCompletion: ProcPtr;
  572.     ioResult: OSErr;
  573.     saveA5: LONGINT;
  574.     reqCode: INTEGER;
  575.  
  576.     queueRef: MSAMQueueRef;
  577.     seqNum: LONGINT;
  578.     msgHint: LONGINT;                    { for posting cache error,set this to 0 when report outq status }
  579.     status: PMSAMStatus;
  580.     END;
  581.  
  582.  
  583. PMSAMLogErrorPB = RECORD
  584.     qLink:    Ptr;
  585.     reservedH1: LONGINT;
  586.     reservedH2: LONGINT;
  587.     ioCompletion: ProcPtr;
  588.     ioResult: OSErr;
  589.     saveA5: LONGINT;
  590.     reqCode: INTEGER;
  591.  
  592.     msamSlotID: MSAMSlotID;                { 0 for PMSAM errors }
  593.     logEntry: ^MailErrorLogEntryInfo;
  594.     filler: ARRAY[1..2] OF LONGINT;
  595.     END;
  596.  
  597.  
  598. {**************************************************************************************}
  599. CONST
  600. kMailMsgSummaryVersion    = 1;
  601.  
  602. TYPE
  603. MailMasterData = RECORD
  604.     attrMask: MailAttributeBitmap;        { indicates attributes present in MsgSummary }
  605.     messageID: MailLetterID;
  606.     replyID: MailLetterID;
  607.     conversationID: MailLetterID;
  608.     END;
  609.  
  610. MailCoreData = RECORD
  611.     letterFlags: MailLetterFlags;
  612.     messageSize: LONGINT;
  613.     letterIndications: MailIndications;
  614.     messageType: OCECreatorType;
  615.     sendTime: MailTime;
  616.     messageFamily: OSType;
  617.     agentInfo: ARRAY[1..2] OF Byte;        { 6 bytes of special info [set to zero] }
  618.     { these are variable length and even padded }
  619.     sender: RString32;                    { recipient's entityName (trunc) }
  620.     subject: RString32;                    { subject maybe truncated }
  621.     END;
  622.  
  623. MSAMMsgSummary = RECORD
  624.     version: INTEGER;                    { following flags are defaulted by Toolbox }
  625.     msgDeleted: BOOLEAN;                { true if msg is to be deleted by PMSAM }
  626.     msgUpdated: BOOLEAN;                { true if msgSummary was updated by MailManager }
  627.     msgCached: BOOLEAN;                    { true if msg is in the slot's InQueue }
  628.     {padByte: Byte;}
  629.     masterData: MailMasterData;
  630.     coreData: MailCoreData;
  631.     END;
  632.  
  633. CONST
  634. kMailMaxPMSAMMsgSummaryData = 128;        { PMSAM can put up to 128 bytes of private msg summary data }
  635.  
  636. TYPE
  637. PMSAMCreateMsgSummaryPB = RECORD
  638.     qLink:    Ptr;
  639.     reservedH1: LONGINT;
  640.     reservedH2: LONGINT;
  641.     ioCompletion: ProcPtr;
  642.     ioResult: OSErr;
  643.     saveA5: LONGINT;
  644.     reqCode: INTEGER;
  645.  
  646.     inQueueRef: MSAMQueueRef;
  647.     seqNum: LONGINT;                { <- seq of the new message }
  648.     msgSummary: ^MSAMMsgSummary;    { attributes and mask filled in }
  649.     buffer: ^MailBuffer;            { PMSAM specific data to be appended }
  650.     END;
  651.  
  652.  
  653. PMSAMPutMsgSummaryPB = RECORD
  654.     qLink:    Ptr;
  655.     reservedH1: LONGINT;
  656.     reservedH2: LONGINT;
  657.     ioCompletion: ProcPtr;
  658.     ioResult: OSErr;
  659.     saveA5: LONGINT;
  660.     reqCode: INTEGER;
  661.  
  662.     inQueueRef: MSAMQueueRef;
  663.     seqNum: LONGINT;
  664.     letterFlags: ^MailMaskedLetterFlags;    { if not nil, then set letterFlags }
  665.     buffer: ^MailBuffer;                    { PMSAM specific data to be overwritten }
  666.     END;
  667.  
  668.  
  669. PMSAMGetMsgSummaryPB = RECORD
  670.     qLink:    Ptr;
  671.     reservedH1: LONGINT;
  672.     reservedH2: LONGINT;
  673.     ioCompletion: ProcPtr;
  674.     ioResult: OSErr;
  675.     saveA5: LONGINT;
  676.     reqCode: INTEGER;
  677.  
  678.     inQueueRef: MSAMQueueRef;
  679.     seqNum: LONGINT;
  680.     msgSummary: ^MSAMMsgSummary;        { if not nil, then read in the msgSummary }
  681.     buffer: ^MailBuffer;                { PMSAM specific data to be read }
  682.     msgSummaryOffset: INTEGER;            { offset of PMSAM specific data  }
  683.                                         { from start of MsgSummary }
  684.     END;
  685.  
  686.  
  687. {**************************************************************************************}
  688. { Definitions for Server MSAMs }
  689. {************************************************************************************}
  690.  
  691. SMSAMAdminCode = INTEGER;
  692.  
  693. CONST
  694. { Values of SMSAMAdminCode }
  695. kSMSAMNotifyFwdrSetupChange        = 1;
  696. kSMSAMNotifyFwdrNameChange        = 2;
  697. kSMSAMNotifyFwdrPwdChange            = 3;
  698. kSMSAMGetDynamicFwdrParams        = 4;
  699.  
  700.  
  701. TYPE
  702. SMSAMSlotChanges = LONGINT;
  703.  
  704. CONST
  705. kSMSAMFwdrHomeInternetChangedBit = 0;
  706. kSMSAMFwdrConnectedToChangedBit = 1;
  707. kSMSAMFwdrForeignRLIsChangedBit = 2;
  708. kSMSAMFwdrMnMServerChangedBit = 3;
  709.  
  710. { Values of SMSAMSlotChanges }
  711. kSMSAMFwdrEverythingChangedMask        = -1;
  712. kSMSAMFwdrHomeInternetChangedMask    = $00000001;  {1<<kSMSAMFwdrHomeInternetChangedBit}
  713. kSMSAMFwdrConnectedToChangedMask    = $00000002;  {1<<kSMSAMFwdrConnectedToChangedBit}
  714. kSMSAMFwdrForeignRLIsChangedMask    = $00000004;  {1<<kSMSAMFwdrForeignRLIsChangedBit}
  715. kSMSAMFwdrMnMServerChangedMask        = $00000008;  {1<<kSMSAMFwdrMnMServerChangedBit}
  716.  
  717.  
  718. TYPE
  719. SMSAMSetupChange = RECORD                { kSMSAMNotifyFwdrSetupChange }
  720.     whatChanged: SMSAMSlotChanges;        {  --> bitmap of what parameters changed }
  721.     serverHint: AddrBlock;                {  --> try this ADAP server first }
  722.     END;
  723.  
  724.  
  725. SMSAMNameChange = RECORD                { kSMSAMNotifyFwdrNameChange }
  726.     newName: RString;                    {  --> msams new name }
  727.     serverHint: AddrBlock;                {  --> try this ADAP server first }
  728.     END;
  729.  
  730.  
  731. SMSAMPasswordChange = RECORD            { kSMSAMNotifyFwdrPasswordChange }
  732.     newPassword: RString;                {  --> msams new password }
  733.     serverHint: AddrBlock;                {  --> try this ADAP server first }
  734.     END;
  735.  
  736.  
  737. SMSAMDynamicParams = RECORD                { kSMSAMGetDynamicFwdrParams }
  738.     curDiskUsed: LONGINT;                { <--  amount of disk space used by msam }
  739.     curMemoryUsed: LONGINT;                { <--  amount of memory used by msam }
  740.     END;
  741.  
  742.  
  743. SMSAMAdminEPPCRequest = RECORD
  744.     adminCode: SMSAMAdminCode;
  745.     CASE INTEGER OF
  746.         1: (setupChange: SMSAMSetupChange);
  747.         2: (nameChange: SMSAMNameChange);
  748.         3: (passwordChange: SMSAMPasswordChange);
  749.         4: (dynamicParams: SMSAMDynamicParams);
  750.     END;
  751.  
  752.  
  753. SMSAMStartupPB = RECORD
  754.     qLink:    Ptr;
  755.     reservedH1: LONGINT;
  756.     reservedH2: LONGINT;
  757.     ioCompletion: ProcPtr;
  758.     ioResult: OSErr;
  759.     saveA5: LONGINT;
  760.     reqCode: INTEGER;
  761.  
  762.     msamIdentity: AuthIdentity;
  763.     queueRef: MSAMQueueRef;
  764.     END;
  765.  
  766.  
  767. SMSAMShutdownPB = RECORD
  768.     qLink:    Ptr;
  769.     reservedH1: LONGINT;
  770.     reservedH2: LONGINT;
  771.     ioCompletion: ProcPtr;
  772.     ioResult: OSErr;
  773.     saveA5: LONGINT;
  774.     reqCode: INTEGER;
  775.  
  776.     queueRef: MSAMQueueRef;
  777.     END;
  778.  
  779.  
  780. {**************************************************************************************}
  781. { Definitions for reading and writing MSAM Letters }
  782. {**************************************************************************************}
  783.  
  784. MSAMEnumeratePB = RECORD
  785.     qLink:    Ptr;
  786.     reservedH1: LONGINT;
  787.     reservedH2: LONGINT;
  788.     ioCompletion: ProcPtr;
  789.     ioResult: OSErr;
  790.     saveA5: LONGINT;
  791.     reqCode: INTEGER;
  792.  
  793.     queueRef: MSAMQueueRef;
  794.     startSeqNum: LONGINT;
  795.     nextSeqNum: LONGINT;
  796.     buffer: MailBuffer;
  797.     { buffer contains a Mail Reply. Each tuple is a
  798.         MSAMEnumerateInQReply when enumerating the inQueue
  799.         MSAMEnumerateOutQReply when enumerating the outQueue
  800.     }
  801.     END;
  802.  
  803.  
  804. MSAMEnumerateInQReply = RECORD
  805.     seqNum: LONGINT;
  806.     msgDeleted: BOOLEAN;                { true if msg is to be deleted by PMSAM }
  807.     msgUpdated: BOOLEAN;                { true if MsgSummary has been updated by TB }
  808.     msgCached: BOOLEAN;                    { true if msg is in the incoming queue }
  809.     {padByte: Byte;}
  810.     END;
  811.  
  812.  
  813. MSAMEnumerateOutQReply = PACKED RECORD
  814.     seqNum: LONGINT;
  815.     done: BOOLEAN;                        { true if all responsible recipients have been processed }
  816.     priority: IPMPriority;
  817.     approxSize: LONGINT;
  818.     tunnelForm: BOOLEAN;                { true if this letter has to be tunnelled }
  819.     padByte: Byte;
  820.     nextHop: NetworkSpec;                { valid if tunnelForm is true }
  821.     msgType: OCECreatorType;            { valid if tunnelForm is true }
  822.     END;
  823.  
  824.  
  825. MSAMDeletePB = PACKED RECORD
  826.     qLink:    Ptr;
  827.     reservedH1: LONGINT;
  828.     reservedH2: LONGINT;
  829.     ioCompletion: ProcPtr;
  830.     ioResult: OSErr;
  831.     saveA5: LONGINT;
  832.     reqCode: INTEGER;
  833.  
  834.     queueRef: MSAMQueueRef;
  835.     seqNum: LONGINT;
  836.     msgOnly: BOOLEAN;                    { only valid for PMSAM & inQueue }
  837.                                         { set true to delete message but not msgSummary }
  838.     padByte: Byte;
  839.     result: OSErr;                        { only valid for SMSAM & tunnelled messages }
  840.                                         { Values for result:
  841.                                             kIPMNoResponsibility
  842.                                             kIPMNoInformation
  843.                                             kIPMRecMaybeNotSent
  844.                                             kIPMRecMaybeSent
  845.                                             }
  846.     END;
  847.  
  848. MSAMOpenPB = RECORD
  849.     qLink:    Ptr;
  850.     reservedH1: LONGINT;
  851.     reservedH2: LONGINT;
  852.     ioCompletion: ProcPtr;
  853.     ioResult: OSErr;
  854.     saveA5: LONGINT;
  855.     reqCode: INTEGER;
  856.  
  857.     queueRef: MSAMQueueRef;
  858.     seqNum: LONGINT;
  859.     mailMsgRef: MailMsgRef;
  860.     END;
  861.  
  862.  
  863. MSAMOpenNestedPB = RECORD
  864.     qLink:    Ptr;
  865.     reservedH1: LONGINT;
  866.     reservedH2: LONGINT;
  867.     ioCompletion: ProcPtr;
  868.     ioResult: OSErr;
  869.     saveA5: LONGINT;
  870.     reqCode: INTEGER;
  871.  
  872.     mailMsgRef: MailMsgRef;
  873.     nestedRef: MailMsgRef;
  874.     END;
  875.  
  876.  
  877. MSAMClosePB = RECORD
  878.     qLink:    Ptr;
  879.     reservedH1: LONGINT;
  880.     reservedH2: LONGINT;
  881.     ioCompletion: ProcPtr;
  882.     ioResult: OSErr;
  883.     saveA5: LONGINT;
  884.     reqCode: INTEGER;
  885.  
  886.     mailMsgRef: MailMsgRef;
  887.     END;
  888.  
  889.  
  890. MSAMGetMsgHeaderPB = RECORD
  891.     qLink:    Ptr;
  892.     reservedH1: LONGINT;
  893.     reservedH2: LONGINT;
  894.     ioCompletion: ProcPtr;
  895.     ioResult: OSErr;
  896.     saveA5: LONGINT;
  897.     reqCode: INTEGER;
  898.  
  899.     mailMsgRef: MailMsgRef;
  900.     selector: IPMHeaderSelector;
  901.     offset: LONGINT;
  902.     buffer: MailBuffer;
  903.     remaining: LONGINT;
  904.     END;
  905.  
  906.  
  907. MSAMGetAttributesPB = RECORD
  908.     qLink:    Ptr;
  909.     reservedH1: LONGINT;
  910.     reservedH2: LONGINT;
  911.     ioCompletion: ProcPtr;
  912.     ioResult: OSErr;
  913.     saveA5: LONGINT;
  914.     reqCode: INTEGER;
  915.  
  916.     mailMsgRef: MailMsgRef;
  917.     requestMask: MailAttributeBitmap;    { kMailIndicationsBit thru kMailSubjectBit }
  918.     buffer: MailBuffer;
  919.     {    buffer returned will contain the attribute values of
  920.         the attributes indicated in responseMask,
  921.         from the attribute indicated by the least significant bit set
  922.         to the attribute indicated by the most significant bit set.
  923.         Note that recipients - from, to, cc, bcc cannot be read using
  924.         this call. Use GetRecipients to read these.
  925.     }
  926.     responseMask: MailAttributeBitmap;
  927.     more: BOOLEAN;
  928.     END;
  929.  
  930. CONST
  931. kMailResolvedList = 0;                    { attrID value to get resolved recipient list }
  932.  
  933. TYPE
  934. MailOriginalRecipient = RECORD
  935.     index: INTEGER;
  936.     { Followed by OCEPackedRecipient }
  937.     END;
  938.  
  939.  
  940.  
  941. MailResolvedRecipient = PACKED RECORD
  942.     index: INTEGER;
  943.     recipientFlags: INTEGER;
  944.     responsible: BOOLEAN;
  945.     padByte: Byte;
  946.     { Followed by OCEPackedRecipient }
  947.     END;
  948.  
  949.  
  950.  
  951. MSAMGetRecipientsPB = RECORD
  952.     qLink:    Ptr;
  953.     reservedH1: LONGINT;
  954.     reservedH2: LONGINT;
  955.     ioCompletion: ProcPtr;
  956.     ioResult: OSErr;
  957.     saveA5: LONGINT;
  958.     reqCode: INTEGER;
  959.  
  960.     mailMsgRef: MailMsgRef;
  961.     attrID: MailAttributeID;            { kMailFromBit thru kMailBccBit }
  962.     startIndex: INTEGER;                { starts at 1 }
  963.     buffer: MailBuffer;
  964.     {     buffer contains a Mail Reply. Each tuple is a
  965.         MailOriginalRecipient if getting original recipients
  966.                                 ie the attrID is kMail[From, To, Cc, Bcc]Bit
  967.         MailResolvedRecipient if getting resolved reicpients
  968.                                 ie the attrID is kMailResolvedList
  969.         Both tuples are word alligned.
  970.     }
  971.     nextIndex: INTEGER;
  972.     more: BOOLEAN;
  973.     END;
  974.  
  975.  
  976. MSAMGetContentPB = RECORD
  977.     qLink:    Ptr;
  978.     reservedH1: LONGINT;
  979.     reservedH2: LONGINT;
  980.     ioCompletion: ProcPtr;
  981.     ioResult: OSErr;
  982.     saveA5: LONGINT;
  983.     reqCode: INTEGER;
  984.  
  985.     mailMsgRef: MailMsgRef;
  986.     segmentMask: MailSegmentMask;
  987.     buffer: MailBuffer;
  988.     textScrap: ^StScrpRec;
  989.     script: ScriptCode;
  990.     segmentType: MailSegmentType;
  991.     endOfScript: BOOLEAN;
  992.     endOfSegment: BOOLEAN;
  993.     endOfContent: BOOLEAN;
  994.     segmentLength: LONGINT;            { NEW: <-  valid first call in a segment }
  995.     segmentID: LONGINT;                { NEW: <-> identifier for this segment }
  996.     END;
  997.  
  998.  
  999. MSAMGetEnclosurePB = PACKED RECORD
  1000.     qLink:    Ptr;
  1001.     reservedH1: LONGINT;
  1002.     reservedH2: LONGINT;
  1003.     ioCompletion: ProcPtr;
  1004.     ioResult: OSErr;
  1005.     saveA5: LONGINT;
  1006.     reqCode: INTEGER;
  1007.  
  1008.     mailMsgRef: MailMsgRef;
  1009.     contentEnclosure: BOOLEAN;
  1010.     padByte: Byte;
  1011.     buffer: MailBuffer;
  1012.     endOfFile: BOOLEAN;
  1013.     endOfEnclosures: BOOLEAN;
  1014.     END;
  1015.  
  1016.  
  1017. MailBlockInfo = RECORD
  1018.     blockType: OCECreatorType;
  1019.     offset: LONGINT;
  1020.     blockLength: LONGINT;
  1021.     END;
  1022.  
  1023.  
  1024. MSAMEnumerateBlocksPB = RECORD
  1025.     qLink:    Ptr;
  1026.     reservedH1: LONGINT;
  1027.     reservedH2: LONGINT;
  1028.     ioCompletion: ProcPtr;
  1029.     ioResult: OSErr;
  1030.     saveA5: LONGINT;
  1031.     reqCode: INTEGER;
  1032.  
  1033.     mailMsgRef: MailMsgRef;
  1034.     startIndex: INTEGER;                { starts at 1 }
  1035.     buffer: MailBuffer;
  1036.     {     buffer contains a Mail Reply. Each tuple is a MailBlockInfo }
  1037.     nextIndex: INTEGER;
  1038.     more: BOOLEAN;
  1039.     END;
  1040.  
  1041.  
  1042. MSAMGetBlockPB = PACKED RECORD
  1043.     qLink:    Ptr;
  1044.     reservedH1: LONGINT;
  1045.     reservedH2: LONGINT;
  1046.     ioCompletion: ProcPtr;
  1047.     ioResult: OSErr;
  1048.     saveA5: LONGINT;
  1049.     reqCode: INTEGER;
  1050.  
  1051.     mailMsgRef: MailMsgRef;
  1052.     blockType: OCECreatorType;
  1053.     blockIndex: INTEGER;
  1054.     buffer: MailBuffer;
  1055.     dataOffset: LONGINT;
  1056.     endOfBlock: BOOLEAN;
  1057.     padByte: Byte;
  1058.     remaining: LONGINT;
  1059.     END;
  1060.  
  1061.  
  1062. MSAMMarkRecipientsPB = RECORD            { not valid for tunnel form letters }
  1063.     qLink:    Ptr;
  1064.     reservedH1: LONGINT;
  1065.     reservedH2: LONGINT;
  1066.     ioCompletion: ProcPtr;
  1067.     ioResult: OSErr;
  1068.     saveA5: LONGINT;
  1069.     reqCode: INTEGER;
  1070.  
  1071.     queueRef: MSAMQueueRef;
  1072.     seqNum: LONGINT;
  1073.     buffer: MailBuffer;
  1074.     {     buffer contains a Mail Reply. Each tuple is an unsigned short,
  1075.         the index of a recipient to be marked. }
  1076.     END;
  1077.  
  1078. {**************************************************************************************}
  1079. MSAMCreatePB = RECORD
  1080.     qLink:    Ptr;
  1081.     reservedH1: LONGINT;
  1082.     reservedH2: LONGINT;
  1083.     ioCompletion: ProcPtr;
  1084.     ioResult: OSErr;
  1085.     saveA5: LONGINT;
  1086.     reqCode: INTEGER;
  1087.  
  1088.     queueRef: MSAMQueueRef;
  1089.     asLetter: BOOLEAN;                    { indicate if we should create as letter or msg }
  1090.     msgType: IPMMsgType;                { is msg creator/type if msg, mail type creator o.w. }
  1091.                                         { default for mail should be: kMailAppleMailCreator, }
  1092.                                         { kMailLtrMsgType }
  1093.                                         { OLD: type lttr indicates create letter }
  1094.     refCon: LONGINT;                    { for messages only }
  1095.     seqNum: LONGINT;                    { set if creating message in the inQueue }
  1096.     tunnelForm: BOOLEAN;                { if true tunnelForm else newForm }
  1097.     bccRecipients: BOOLEAN;                { true if creating letter with bcc recipients }
  1098.     newRef: MailMsgRef;
  1099.     END;
  1100.  
  1101.  
  1102. MSAMBeginNestedPB = RECORD
  1103.     qLink:    Ptr;
  1104.     reservedH1: LONGINT;
  1105.     reservedH2: LONGINT;
  1106.     ioCompletion: ProcPtr;
  1107.     ioResult: OSErr;
  1108.     saveA5: LONGINT;
  1109.     reqCode: INTEGER;
  1110.  
  1111.     mailMsgRef: MailMsgRef;
  1112.     refCon: LONGINT;                    { for messages only }
  1113.     msgType: IPMMsgType;
  1114.     END;
  1115.  
  1116.  
  1117. MSAMEndNestedPB = RECORD
  1118.     qLink:    Ptr;
  1119.     reservedH1: LONGINT;
  1120.     reservedH2: LONGINT;
  1121.     ioCompletion: ProcPtr;
  1122.     ioResult: OSErr;
  1123.     saveA5: LONGINT;
  1124.     reqCode: INTEGER;
  1125.  
  1126.     mailMsgRef: MailMsgRef;
  1127.     END;
  1128.  
  1129.  
  1130. MSAMSubmitPB = PACKED RECORD
  1131.     qLink:    Ptr;
  1132.     reservedH1: LONGINT;
  1133.     reservedH2: LONGINT;
  1134.     ioCompletion: ProcPtr;
  1135.     ioResult: OSErr;
  1136.     saveA5: LONGINT;
  1137.     reqCode: INTEGER;
  1138.  
  1139.     mailMsgRef: MailMsgRef;
  1140.     submitFlag: BOOLEAN;
  1141.     padByte: Byte;
  1142.     msgID: MailLetterID;
  1143.     END;
  1144.  
  1145.  
  1146. MSAMPutMsgHeaderPB = PACKED RECORD
  1147.     qLink:    Ptr;
  1148.     reservedH1: LONGINT;
  1149.     reservedH2: LONGINT;
  1150.     ioCompletion: ProcPtr;
  1151.     ioResult: OSErr;
  1152.     saveA5: LONGINT;
  1153.     reqCode: INTEGER;
  1154.  
  1155.     mailMsgRef: MailMsgRef;
  1156.     replyQueue: ^OCERecipient;
  1157.     sender: ^IPMSender;
  1158.     deliveryNotification: IPMNotificationType;
  1159.     priority: IPMPriority;
  1160.     END;
  1161.  
  1162.  
  1163. MSAMPutAttributePB = RECORD
  1164.     qLink:    Ptr;
  1165.     reservedH1: LONGINT;
  1166.     reservedH2: LONGINT;
  1167.     ioCompletion: ProcPtr;
  1168.     ioResult: OSErr;
  1169.     saveA5: LONGINT;
  1170.     reqCode: INTEGER;
  1171.  
  1172.     mailMsgRef: MailMsgRef;
  1173.     attrID: MailAttributeID;            { kMailIndicationsBit thru kMailSubjectBit }
  1174.     buffer: MailBuffer;
  1175.     END;
  1176.  
  1177.  
  1178. MSAMPutRecipientPB = RECORD
  1179.     qLink:    Ptr;
  1180.     reservedH1: LONGINT;
  1181.     reservedH2: LONGINT;
  1182.     ioCompletion: ProcPtr;
  1183.     ioResult: OSErr;
  1184.     saveA5: LONGINT;
  1185.     reqCode: INTEGER;
  1186.  
  1187.     mailMsgRef: MailMsgRef;
  1188.     attrID: MailAttributeID;            { kMailFromBit thru kMailBccBit }
  1189.     recipient: ^MailRecipient;
  1190.     responsible: BOOLEAN;                { valid for server and message msams only }
  1191.     END;
  1192.  
  1193.  
  1194. MSAMPutContentPB = PACKED RECORD
  1195.     qLink:    Ptr;
  1196.     reservedH1: LONGINT;
  1197.     reservedH2: LONGINT;
  1198.     ioCompletion: ProcPtr;
  1199.     ioResult: OSErr;
  1200.     saveA5: LONGINT;
  1201.     reqCode: INTEGER;
  1202.  
  1203.     mailMsgRef: MailMsgRef;
  1204.     segmentType: MailSegmentType;
  1205.     append: BOOLEAN;
  1206.     padByte: Byte;
  1207.     buffer: MailBuffer;
  1208.     textScrap: ^StScrpRec;
  1209.     startNewScript: BOOLEAN;
  1210.     script: ScriptCode;                { valid only if startNewScript is true }
  1211.     END;
  1212.  
  1213.  
  1214. MSAMPutEnclosurePB = RECORD
  1215.     qLink:    Ptr;
  1216.     reservedH1: LONGINT;
  1217.     reservedH2: LONGINT;
  1218.     ioCompletion: ProcPtr;
  1219.     ioResult: OSErr;
  1220.     saveA5: LONGINT;
  1221.     reqCode: INTEGER;
  1222.  
  1223.     mailMsgRef: MailMsgRef;
  1224.     contentEnclosure: BOOLEAN;
  1225.     padByte: BOOLEAN;
  1226.     hfs: BOOLEAN;                        { true => in file system, false => in memory }
  1227.     append: BOOLEAN;
  1228.     buffer: MailBuffer;                    { Unused if hfs == true }
  1229.     enclosure: FSSpec;
  1230.     addlInfo: MailEnclosureInfo;
  1231.     END;
  1232.  
  1233.  
  1234. MSAMPutBlockPB = RECORD
  1235.     qLink:    Ptr;
  1236.     reservedH1: LONGINT;
  1237.     reservedH2: LONGINT;
  1238.     ioCompletion: ProcPtr;
  1239.     ioResult: OSErr;
  1240.     saveA5: LONGINT;
  1241.     reqCode: INTEGER;
  1242.  
  1243.     mailMsgRef: MailMsgRef;
  1244.     refCon: LONGINT;                    { for messages only }
  1245.     blockType: OCECreatorType;
  1246.     append: BOOLEAN;
  1247.     buffer: MailBuffer;
  1248.     mode: MailBlockMode;                { if blockType is kMailTunnelLtrType or kMailHopInfoType }
  1249.                                         { mode is assumed to be kMailFromMark }
  1250.     offset: LONGINT;
  1251.     END;
  1252.  
  1253.  
  1254. {**************************************************************************************}
  1255. MSAMCreateReportPB = RECORD
  1256.     qLink:    Ptr;
  1257.     reservedH1: LONGINT;
  1258.     reservedH2: LONGINT;
  1259.     ioCompletion: ProcPtr;
  1260.     ioResult: OSErr;
  1261.     saveA5: LONGINT;
  1262.     reqCode: INTEGER;
  1263.  
  1264.     queueRef: MSAMQueueRef;            { to distinguish personal and server MSAMs }
  1265.     mailMsgRef: MailMsgRef;
  1266.     msgID: MailLetterID;            { kMailLetterIDBit of letter being reported upon }
  1267.     sender: ^MailRecipient;            { sender of the letter you are creating report on }
  1268.     END;
  1269.  
  1270.  
  1271. MSAMPutRecipientReportPB = RECORD
  1272.     qLink:    Ptr;
  1273.     reservedH1: LONGINT;
  1274.     reservedH2: LONGINT;
  1275.     ioCompletion: ProcPtr;
  1276.     ioResult: OSErr;
  1277.     saveA5: LONGINT;
  1278.     reqCode: INTEGER;
  1279.  
  1280.     mailMsgRef: MailMsgRef;
  1281.     recipientIndex: INTEGER;            { recipient index in the original letter }
  1282.     result: OSErr;                        { result of sending the recipient }
  1283.                                         { Values for result:
  1284.                                             kIPMNoResponsibility
  1285.                                             kIPMNoInformation
  1286.                                             kIPMRecMaybeNotSent
  1287.                                             kIPMRecMaybeSent
  1288.                                         }
  1289.     END;
  1290.  
  1291. {**************************************************************************************}
  1292.  
  1293. MailWakeupPMSAMPB = RECORD
  1294.     qLink:    Ptr;
  1295.     reservedH1: LONGINT;
  1296.     reservedH2: LONGINT;
  1297.     ioCompletion: ProcPtr;
  1298.     ioResult: OSErr;
  1299.     saveA5: LONGINT;
  1300.     reqCode: INTEGER;
  1301.  
  1302.     pmsamCID: CreationID;
  1303.     mailSlotID: MailSlotID;
  1304.     END;
  1305.  
  1306.  
  1307. MailCreateMailSlotPB = RECORD
  1308.     qLink:    Ptr;
  1309.     reservedH1: LONGINT;
  1310.     reservedH2: LONGINT;
  1311.     ioCompletion: ProcPtr;
  1312.     ioResult: OSErr;
  1313.     saveA5: LONGINT;
  1314.     reqCode: INTEGER;
  1315.  
  1316.     mailboxRef: MailboxRef;
  1317.     timeout: LONGINT;
  1318.     pmsamCID: CreationID;
  1319.     smca: SMCA;
  1320.     END;
  1321.  
  1322.  
  1323. MailModifyMailSlotPB = RECORD
  1324.     qLink:    Ptr;
  1325.     reservedH1: LONGINT;
  1326.     reservedH2: LONGINT;
  1327.     ioCompletion: ProcPtr;
  1328.     ioResult: OSErr;
  1329.     saveA5: LONGINT;
  1330.     reqCode: INTEGER;
  1331.  
  1332.     mailboxRef: MailboxRef;
  1333.     timeout: LONGINT;
  1334.     pmsamCID: CreationID;
  1335.     smca: SMCA;
  1336.     END;
  1337.  
  1338.  
  1339. MailDeleteMailSlotPB = RECORD
  1340.     qLink:    Ptr;
  1341.     reservedH1: LONGINT;
  1342.     reservedH2: LONGINT;
  1343.     ioCompletion: ProcPtr;
  1344.     ioResult: OSErr;
  1345.     saveA5: LONGINT;
  1346.     reqCode: INTEGER;
  1347.  
  1348.     mailboxRef: MailboxRef;
  1349.     timeout: LONGINT;
  1350.     pmsamCID: CreationID;
  1351.     smca: SMCA;
  1352.     END;
  1353.  
  1354.  
  1355. {**************************************************************************************}
  1356. CONST
  1357. kPMSAMGetMSAMRecord        = 1286;
  1358. kPMSAMOpenQueues        = 1280;
  1359. kPMSAMLogError            = 1313;
  1360. kPMSAMSetStatus            = 1319;
  1361.  
  1362. kPMSAMCreateMsgSummary    = 1314;
  1363. kPMSAMPutMsgSummary        = 1317;
  1364. kPMSAMGetMsgSummary        = 1318;
  1365.  
  1366. kMailWakeupPMSAM        = 1287;
  1367.  
  1368. kSMSAMStartup            = 1281;
  1369. kSMSAMShutdown            = 1282;
  1370.  
  1371. kMSAMEnumerate            = 1283;
  1372. kMSAMDelete                = 1284;
  1373.  
  1374. kMSAMOpen                = 1288;
  1375. kMSAMOpenNested            = 1289;
  1376. kMSAMClose                = 1290;
  1377. kMSAMGetMsgHeader        = 1297;
  1378. kMSAMGetAttributes        = 1291;
  1379. kMSAMGetRecipients        = 1292;
  1380. kMSAMGetContent            = 1293;
  1381. kMSAMGetEnclosure        = 1294;
  1382. kMSAMEnumerateBlocks    = 1295;
  1383. kMSAMGetBlock            = 1296;
  1384. kMSAMMarkRecipients        = 1285;
  1385.  
  1386. kMSAMCreate                = 1300;
  1387. kMSAMBeginNested        = 1301;
  1388. kMSAMEndNested            = 1302;
  1389. kMSAMSubmit                = 1303;
  1390. kMSAMPutMsgHeader        = 1309;
  1391. kMSAMPutAttribute        = 1304;
  1392. kMSAMPutRecipient        = 1305;
  1393. kMSAMPutContent            = 1306;
  1394. kMSAMPutEnclosure        = 1307;
  1395. kMSAMPutBlock            = 1308;
  1396.  
  1397. kMSAMCreateReport        = 1311;
  1398. kMSAMPutRecipientReport    = 1312;
  1399.  
  1400. kMailCreateMailSlot        = 1323;
  1401. kMailModifyMailSlot        = 1324;
  1402. kMailDeleteMailSlot        = 1325;
  1403.  
  1404.  
  1405. TYPE
  1406. MSAMParam = RECORD
  1407.     CASE INTEGER OF
  1408.         1: (header: MailParamBlockHeader);
  1409.         2: (pmsamGetMSAMRecord: PMSAMGetMSAMRecordPB);
  1410.         3: (pmsamOpenQueues: PMSAMOpenQueuesPB);
  1411.         4: (pmsamSetStatus: PMSAMSetStatusPB);
  1412.         5: (pmsamLogError: PMSAMLogErrorPB);
  1413.         6: (smsamStartup: SMSAMStartupPB);
  1414.         7: (smsamShutdown: SMSAMShutdownPB);
  1415.         8: (msamEnumerate: MSAMEnumeratePB);
  1416.         9: (msamDelete: MSAMDeletePB);
  1417.         10: (msamOpen: MSAMOpenPB);
  1418.         11: (msamOpenNested: MSAMOpenNestedPB);
  1419.         12: (msamClose: MSAMClosePB);
  1420.         13: (msamGetMsgHeader: MSAMGetMsgHeaderPB);
  1421.         14: (msamGetAttributes: MSAMGetAttributesPB);
  1422.         15: (msamGetRecipients: MSAMGetRecipientsPB);
  1423.         16: (msamGetContent: MSAMGetContentPB);
  1424.         17: (msamGetEnclosure: MSAMGetEnclosurePB);
  1425.         18: (msamEnumerateBlocks: MSAMEnumerateBlocksPB);
  1426.         19: (msamGetBlock: MSAMGetBlockPB);
  1427.         20: (msamMarkRecipients: MSAMMarkRecipientsPB);
  1428.         21: (msamCreate: MSAMCreatePB);
  1429.         22: (msamBeginNested: MSAMBeginNestedPB);
  1430.         23: (msamEndNested: MSAMEndNestedPB);
  1431.         24: (msamSubmit: MSAMSubmitPB);
  1432.         25: (msamPutMsgHeader: MSAMPutMsgHeaderPB);
  1433.         26: (msamPutAttribute: MSAMPutAttributePB);
  1434.         27: (msamPutRecipient: MSAMPutRecipientPB);
  1435.         28: (msamPutContent: MSAMPutContentPB);
  1436.         29: (msamPutEnclosure: MSAMPutEnclosurePB);
  1437.         30: (msamPutBlock: MSAMPutBlockPB);
  1438.         31: (msamCreateReport: MSAMCreateReportPB);        { Reports and Error Handling Calls }
  1439.         32: (msamPutRecipientReport: MSAMPutRecipientReportPB);
  1440.         35: (pmsamCreateMsgSummary: PMSAMCreateMsgSummaryPB);
  1441.         36: (pmsamPutMsgSummary: PMSAMPutMsgSummaryPB);
  1442.         37: (pmsamGetMsgSummary: PMSAMGetMsgSummaryPB);
  1443.         38: (wakeupPMSAM: MailWakeupPMSAMPB);
  1444.         39: (createMailSlot: MailCreateMailSlotPB);
  1445.         40: (modifyMailSlot: MailModifyMailSlotPB);
  1446.         41: (deleteMailSlot: MailDeleteMailSlotPB);
  1447.     END;
  1448.  
  1449.  
  1450.  
  1451.  
  1452. FUNCTION MailCreateMailSlot(VAR paramBlock: MSAMParam): OSErr;     { ASYNCHRONOUS ONLY, client must call WaitNextEvent }
  1453.     INLINE $7001, $1f00, $3f3c, kMailCreateMailSlot, _oceTBDispatch;
  1454. FUNCTION MailModifyMailSlot(VAR paramBlock: MSAMParam): OSErr;     { ASYNCHRONOUS ONLY, client must call WaitNextEvent }
  1455.     INLINE $7001, $1f00, $3f3c, kMailModifyMailSlot, _oceTBDispatch;
  1456. FUNCTION MailDeleteMailSlot(VAR paramBlock: MSAMParam): OSErr;  { ASYNCHRONOUS ONLY, client must call WaitNextEvent }
  1457.     INLINE $7001, $1f00, $3f3c, kMailDeleteMailSlot, _oceTBDispatch;
  1458. FUNCTION MailWakeupPMSAM(VAR paramBlock: MSAMParam): OSErr;      { ASYNCHRONOUS ONLY, client must call WaitNextEvent }
  1459.     INLINE $7001, $1f00, $3f3c, kMailWakeupPMSAM, _oceTBDispatch;
  1460.  
  1461. { Personal MSAM Glue Routines }
  1462. FUNCTION PMSAMOpenQueues(VAR paramBlock: MSAMParam): OSErr;
  1463.     INLINE $7000, $1f00, $3f3c, kPMSAMOpenQueues, _oceTBDispatch;
  1464. FUNCTION PMSAMSetStatus(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1465.     INLINE $3f3c, kPMSAMSetStatus, _oceTBDispatch;
  1466. FUNCTION PMSAMGetMSAMRecord(VAR paramBlock: MSAMParam): OSErr;    { SYNC ONLY }
  1467.     INLINE $7000, $1f00, $3f3c, kPMSAMGetMSAMRecord, _oceTBDispatch;
  1468.  
  1469. { Server MSAM Glue Routines }
  1470. FUNCTION SMSAMStartup(VAR paramBlock: MSAMParam): OSErr;        { SYNC ONLY }
  1471.     INLINE $7000, $1f00, $3f3c, kSMSAMStartup, _oceTBDispatch;
  1472. FUNCTION SMSAMShutdown(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1473.     INLINE $3f3c, kSMSAMShutdown, _oceTBDispatch;
  1474.  
  1475. { Get Interface Glue Routines }
  1476. FUNCTION MSAMEnumerate(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1477.     INLINE $3f3c, kMSAMEnumerate, _oceTBDispatch;
  1478. FUNCTION MSAMDelete(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1479.     INLINE $3f3c, kMSAMDelete, _oceTBDispatch;
  1480. FUNCTION MSAMMarkRecipients(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1481.     INLINE $3f3c, kMSAMMarkRecipients, _oceTBDispatch;
  1482.  
  1483. FUNCTION MSAMOpen(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1484.     INLINE $3f3c, kMSAMOpen, _oceTBDispatch;
  1485. FUNCTION MSAMOpenNested(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1486.     INLINE $3f3c, kMSAMOpenNested, _oceTBDispatch;
  1487. FUNCTION MSAMClose(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1488.     INLINE $3f3c, kMSAMClose, _oceTBDispatch;
  1489.  
  1490. FUNCTION MSAMGetRecipients(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1491.     INLINE $3f3c, kMSAMGetRecipients, _oceTBDispatch;
  1492. FUNCTION MSAMGetAttributes(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1493.     INLINE $3f3c, kMSAMGetAttributes, _oceTBDispatch;
  1494. FUNCTION MSAMGetContent(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1495.     INLINE $3f3c, kMSAMGetContent, _oceTBDispatch;
  1496. FUNCTION MSAMGetEnclosure(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1497.     INLINE $3f3c, kMSAMGetEnclosure, _oceTBDispatch;
  1498. FUNCTION MSAMEnumerateBlocks(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1499.     INLINE $3f3c, kMSAMEnumerateBlocks, _oceTBDispatch;
  1500. FUNCTION MSAMGetBlock(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1501.     INLINE $3f3c, kMSAMGetBlock, _oceTBDispatch;
  1502. FUNCTION MSAMGetMsgHeader(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1503.     INLINE $3f3c, kMSAMGetMsgHeader, _oceTBDispatch;
  1504.  
  1505. { Put Interface Glue Routines }
  1506. FUNCTION MSAMCreate(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1507.     INLINE $3f3c, kMSAMCreate, _oceTBDispatch;
  1508. FUNCTION MSAMBeginNested(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1509.     INLINE $3f3c, kMSAMBeginNested, _oceTBDispatch;
  1510. FUNCTION MSAMEndNested(VAR paramBlock: MSAMParam): OSErr;
  1511.     INLINE $7000, $1f00, $3f3c, kMSAMEndNested, _oceTBDispatch;
  1512. FUNCTION MSAMSubmit(VAR paramBlock: MSAMParam): OSErr;
  1513.     INLINE $7000, $1f00, $3f3c, kMSAMSubmit, _oceTBDispatch;        {  SYNCHRONOUS ONLY }
  1514.  
  1515. FUNCTION MSAMPutAttribute(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1516.     INLINE $3f3c, kMSAMPutAttribute, _oceTBDispatch;
  1517. FUNCTION MSAMPutRecipient(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1518.     INLINE $3f3c, kMSAMPutRecipient, _oceTBDispatch;
  1519. FUNCTION MSAMPutContent(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1520.     INLINE $3f3c, kMSAMPutContent, _oceTBDispatch;
  1521. FUNCTION MSAMPutEnclosure(VAR paramBlock: MSAMParam): OSErr;
  1522.     INLINE $7000, $1f00, $3f3c, kMSAMPutEnclosure, _oceTBDispatch;    {  SYNCHRONOUS ONLY }
  1523. FUNCTION MSAMPutBlock(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1524.     INLINE $3f3c, kMSAMPutBlock, _oceTBDispatch;
  1525. FUNCTION MSAMPutMsgHeader(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1526.     INLINE $3f3c, kMSAMPutMsgHeader, _oceTBDispatch;
  1527.  
  1528. { Reports and Error Handling Glue Routines }
  1529. FUNCTION MSAMCreateReport(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1530.     INLINE $3f3c, kMSAMCreateReport, _oceTBDispatch;
  1531. FUNCTION MSAMPutRecipientReport(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1532.     INLINE $3f3c, kMSAMPutRecipientReport, _oceTBDispatch;
  1533. FUNCTION PMSAMLogError(VAR paramBlock: MSAMParam): OSErr;
  1534.     INLINE $7000, $1f00, $3f3c, kPMSAMLogError, _oceTBDispatch;
  1535.  
  1536. { MsgSummary Glue Routines }
  1537. FUNCTION PMSAMCreateMsgSummary(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1538.     INLINE $3f3c, kPMSAMCreateMsgSummary, _oceTBDispatch;
  1539. FUNCTION MSAMPutMsgSummary(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1540.     INLINE $3f3c, kPMSAMPutMsgSummary, _oceTBDispatch;
  1541. FUNCTION MSAMGetMsgSummary(VAR paramBlock: MSAMParam; asyncFlag: BOOLEAN): OSErr;
  1542.     INLINE $3f3c, kPMSAMGetMsgSummary, _oceTBDispatch;
  1543.  
  1544.  
  1545.  
  1546. {$ENDC}    { UsingOCEMail }
  1547.  
  1548. {$IFC NOT UsingIncludes}
  1549.     END.
  1550. {$ENDC}
  1551.